{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x1145023c8>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD4CAYAAAAAczaOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3dd3RUZf7H8fc3jYQaSmgRBDGAFAHJSpViAxEFsayuBSui4KK/VRddd23r6gqigoKiYld0LYiAFKX3Li2U0Am990CS5/dHLrsREwiQ5E5mPq9zcjJ55s7kO/fkfObmuc98rznnEBGR0BDmdwEiIlJwFPoiIiFEoS8iEkIU+iIiIUShLyISQiL8LuBUypUr56pVq+Z3GSIihcq8efN2OufisrsvoEO/WrVqzJ071+8yREQKFTNbn9N9mt4REQkhCn0RkRCi0BcRCSEKfRGREKLQFxEJIQp9EZEQotAXEQkhQRn66RmOf41KYuPuw36XIiISUIIy9NfvOsTQ2Ru4YeB0Fm/a53c5IiIBIyhD/4K44nz7UHOKRIRxy7szGL98m98liYgEhKAMfYCECiX4vkdzapQvxv0fz+WzmTl+KllEJGQEbegDlC8RzVfdmtGmVnmeGbaEV35aTkaGLg8pIqErqEMfoFiRCAbf2Zjbm1TlnUmr6fXVQlLT0v0uS0TEFwHdZTOvRISH8c/O9ahSpiiv/LScrfuO8O6diZQpFuV3aSIiBSroj/RPMDO6t67BW39qxK+b9tH57Wkkbz/od1kiIgUqZEL/hI4XV2Zot6YcPpZGl4HTmJa80++SREQKTMiFPsAlVUvz/cMtqFQqhq5DZvPl7A1+lyQiUiBCMvQBqpQpyjcPNaPFheV46rvFvDRyGela2SMiQS5kQx+gRHQkH3R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FbzayImVUnc9/MBuYACWZW3cyiyDyROdzHOvOdd47nhBvIPPkNOe+jUBJyfw9nS0f6BcjMbgAGAHHASDNb6JxrB7QCXjCz40AG0N05t9t72MPAR0AMmat2gnHlTo77xjm31My+BpYBaUCPE6tSzKwnMAYIB4Y455b6VH5BedXMGpI5vbMOeBDgVPsoVDjn0kLw7+GsqA2DiEgI0fSOiEgIUeiLiIQQhb6ISAhR6IuIhBCFvohICFHoi4iEEIW+iEgI+X+hH/mMirZ4twAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy\n",
    "\n",
    "x = numpy.linspace(-180, 36)\n",
    "\n",
    "servo_angle_pws = [\n",
    "    [-162, 2490],\n",
    "    [-144, 2270],\n",
    "    [-126, 2070],\n",
    "    [-108, 1880],\n",
    "    [ -90, 1680],\n",
    "    [ -72, 1540],\n",
    "    [ -54, 1360],\n",
    "    [ -36, 1190],\n",
    "    [ -18, 1020],\n",
    "    [   0,  830],\n",
    "    [  18,  610],\n",
    "]\n",
    "\n",
    "# for i in range(len(servo_1_array))[1:]:\n",
    "#     print(\"Using %s terms\" %i)\n",
    "               \n",
    "servo_array = numpy.array(servo_angle_pws)\n",
    "angles_to_pw = numpy.poly1d(\n",
    "    numpy.polyfit(\n",
    "        servo_array[:,0],\n",
    "        servo_array[:,1],\n",
    "        3  # try different values to see how more/fewer terms in the polynomial function affect results\n",
    "    )\n",
    ")\n",
    "\n",
    "plt.plot(x, angles_to_pw(x))\n",
    "x, y = servo_array.T\n",
    "plt.scatter(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "len(servo_1_array)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
